﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.DAL;

namespace MINERP.BLL.Common
{
    /// <summary>
    /// 对商户进行的一些逻辑操作
    /// </summary>
    public class ShopBLL
    {
        /// <summary>
        /// 根据商户名字得到商户，如果不存在则返回NULL 
        /// </summary>
        /// <param name="shopName"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        public Shop GetShopByShopName(string shopName, newSampleYPDBEntities db)
        {
            if (string.IsNullOrEmpty(shopName))
            {
                return null;
            }
            return db.Shop.FirstOrDefault(s => s.shopName == shopName);
        }
    }
}
